<template>
  <diy-container
    :status="pageStatus"
    :border-bottom="false"
    :color="pageDetail.color"
    ref="container"
    :title="pageDetail.title"
    :headerVisable="true"
    :headerBackGroudColor="pageDetail.backgroundColor"
    :headerBackgroundImage="pageDetail.backgroundImage"
    :tabbarIsShow="false"
    :isShowLeft="true"
  >
    <view class="body">
      <view class="content-list">
        <view class="bg">
          <view class="info">请上传您的机动车行驶证</view>
          <view class="text">(您上传的照片资料仅作认证使用)</view>
          <view class="upload">
            <view class="up">
              <image
                v-if="user.imgUserDesignUrl"
                :src="user.imgUserDesignUrl"
                mode="aspectFill"
                @click="val => chooseImage()"
              ></image>
              <view @click="val => chooseImage()" v-if="!user.imgUserDesignUrl">
                <image src="../../static/images/schuan.png" mode=""></image>
              </view>
            </view>
            <view class="box">
              <image src="../../static/images/castleimg.png" class="img" mode=""></image>
              <view class="illustration">示例</view>
            </view>
          </view>
          <view style="color: #666; font-size: 24rpx; margin-top: 20rpx">
            请确保提交的信息真实有效，盗用他人资料认证将会被封号！
          </view>

          <view class="btns">下一步</view>
        </view>
      </view>
    </view>
  </diy-container>
</template>

<script>
export default {
  data() {
    return {
      pageDetail: {
        title: "车认证",
        backgroundColor: "#ffffff",
        color: "rgb(51, 51, 51)",
        backgroundImage: ""
      },
      user: {
        imgUserDesignUrl: ""
      }
    };
  },
  onLoad() {
    this.getDiamondData();
  },
  methods: {
    getDiamondData() {
      this.showPageContent();
    },
    chooseImage() {
      uni.chooseImage({
        count: 1,
        type: "image",
        sizeType: ["compressed"],
        sourceType: ["album", "camera"],
        success: res => {
          this.user.imgUserDesignUrl = res.tempFilePaths[0];
        }
      });
    }
  }
};
</script>

<style scoped lang="scss">
.body {
  height: 100vh;
  background-color: #f4f5f6;
}
.content-list {
  background-image: url("../../static/images/bg3.png");
  background-repeat: no-repeat;
  background-size: 100%;
  height: 536rpx;
  padding: 0 20px;
  .bg {
    position: absolute;
    top: 460rpx;
    background: #ffffff;
    width: 620rpx;
    // height: 500rpx;
    border-radius: 12rpx;
    padding: 0 25rpx;
    padding-bottom: 25rpx;
    .tagging {
      display: flex;
      padding: 25rpx 0;
      border-bottom: 1rpx solid #ededed;
      .title {
        font-size: 28rpx;
        color: #666;
        width: 200rpx;
        text-align: left;
      }
      .wz-input {
        width: 552rpx;
        // height: 80rpx;
        font-size: 28rpx;
        color: #333;
        padding: 0 20rpx;
        text-align: right;
      }
    }
    .info {
      color: #555555;
      font-size: 32rpx;
      margin-top: 20rpx;
    }
    .text {
      font-size: 24rpx;
      color: #fe7c84;
    }
    .upload {
      display: flex;
      justify-content: space-between;
      border-bottom: 1rpx solid #ededed;
      margin-top: 20rpx;
      padding: 20rpx 0;
      .text {
        width: 128rpx;
        text-align: right;
        font-size: 32rpx;
        color: #333;
      }
      .up {
        display: flex;
        image {
          width: 210rpx;
          height: 160rpx;
          margin-right: 20rpx;
          border-radius: 8rpx;
        }
      }
      .box {
        position: relative;
        .img {
          width: 210rpx;
          height: 160rpx;
          border-radius: 8rpx;
        }
        .illustration {
          position: absolute;
          top: 0;
          right: 0;
          background: #ff758f;
          color: #ffffff;
          font-size: 24rpx;
          padding: 5rpx 10rpx;
          border-top-right-radius: 8rpx;
          border-bottom-left-radius: 8rpx;
        }
      }
    }
    .btns {
      width: 620rpx;
      height: 80rpx;
      background: #fea4a6;
      border-radius: 200rpx 200rpx 200rpx 200rpx;
      font-size: 28rpx;
      color: #ffffff;
      line-height: 80rpx;
      text-align: center;
      margin-top: 30rpx;
    }
  }
}
</style>
